Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Hierarchical dispersion added to other-bucket model #53

Open
wants to merge 5 commits into
base: otherbucket
Choose a base branch
from

Conversation

maximz
Copy link
Collaborator

@maximz maximz commented Dec 21, 2017

No description provided.

@maximz maximz requested a review from jburos December 21, 2017 23:48
Copy link
Member

@jburos jburos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few minor comments/suggestions but overall looks great. the only major issue is the sample2_x noted.

looking at this again i feel we should revisit the many normal(0,1) priors. going to put this on my list for the weekend

corrected_phis = exp(corrected_phis);

for (s in 1:S2)
corrected_phis2[s] = log_global_phi_scale + log_gene_phi + log_sample2_scale[s] + log(celltype_scale * sample_x[s]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably be sample2_x

corrected_phis2 = exp(corrected_phis2);

for(g in 1:G)
ones[g] = 1; // initialize a vector of all ones (for dirichlet prior)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be in transformed data block

vector[C] theta_tmp; // temporary predictor for cell-gene-specific expression level
theta_coefs_per_gene[g] ~ normal(0, 1);
theta_tmp = theta_mu + cell_features*theta_coefs[g];
theta[g] ~ multi_normal_cholesky(theta_tmp, diag_pre_multiply(Omega_sigma, Omega_L));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should prob do diag_pre_multiply part outside of the for (g in 1:G) loop. computing this for every gene could get expensive.

for (g in 1:G) {
vector[C] theta_tmp; // temporary predictor for cell-gene-specific expression level
theta_coefs_per_gene[g] ~ normal(0, 1);
theta_tmp = theta_mu + cell_features*theta_coefs[g];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, appears that this is the cell features model ?!


for (s in 1:S)
corrected_phis[s] = log_global_phi_scale + log_gene_phi + log_sample_scale[s] + log(celltype_scale * sample_x[s]);
corrected_phis = exp(corrected_phis);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have more often seen this done by using a temp variable within the loop & declaring the corrected_phis using a constraint for clarity. but i like the clarity here .. fine with me.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants